import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

class Emp implements Comparable<Emp>{
	private String name;
	private String addr;
	private int sal;
	
	Emp(String name, String addr, int sal){
		this.name = name;
		this.addr = addr;
		this.sal = sal;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public int getSal() {
		return sal;
	}

	public void setSal(int sal) {
		this.sal = sal;
	}
	public int compareTo(Emp e){
		int ss = e.getSal();
		
		//ascending order
		//return this.sal-ss;
		
		//desending order
		//return ss-this.sal;
		
		//return this.name.toUpperCase().compareTo(e.getName().toUpperCase());
		
		return e.name.toUpperCase().compareTo(this.name.toUpperCase());
		
		
	}
	
	/*public static Comparator<Emp> comp = new Comparator<Emp>(){
		public int compare(Emp e1, Emp e2){
			//return e1.getName().toUpperCase().compareTo(e2.getName().toUpperCase());
			return e2.getName().toUpperCase().compareTo(e1.getName().toUpperCase());
		}
	};*/
}
public class SortBySal {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		List<Emp> l = new ArrayList<Emp>();
		l.add(new Emp("b","bbb",5500));
		l.add(new Emp("s","sss",4500));
		l.add(new Emp("p","ppp",3500));
		//Collections.sort(l,Emp.comp);
		Collections.sort(l);
		
		for(Emp e:l){
			System.out.println(e.getName()+" "+e.getAddr()+" "+e.getSal());
		}
	}

}
